'use strict'

class login{

    constructor () {
        this.param='/'
    }

    async post(c){
      //console.log(JSON.parse(c.body.toString()));
      
      let data=await c.service.model.login.insert(c.body.toString())
            
      if(data==='你已登录'){
        let d={
          'msg':'登录失败 fail',
          'data':data,
          'code':0
        }
        c.send(d)
      }else{
        let d={
          'msg':'登录成功 success',
          'data':data,
          'code':1
        }
        c.send(d)
      }
      
      //c.send('ok')
    }

}

module.exports = login
